﻿using Assets.Scripts.UI;
using System.Collections;
using UnityEngine;

namespace Assets.Scripts.System.GameState
{
    public class CMDState : IState<global::GameState>
    {
        public void OnEnter(global::GameState fromStateType)
        {
            UIManager.Instance.PushPanel(UIPanelType.CMDPanel);
        }

        public void OnExit(global::GameState toStateType)
        {
            if (UIManager.Instance.GetTopPanel().GetPanelType() == UIPanelType.CMDPanel)
            {
                UIManager.Instance.PopPanel();
            }
        }

        public void OnUpdate()
        {
            if(Input.GetKeyDown(KeyCode.BackQuote))
            {
                GameManager.Instance.TranslatePreviousGameState();
            }
        }
    }
}